﻿Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Forecast.Logica.Enumeradores
Imports Forecast.Logica.Servicios

Public Class Login
    Inherits System.Web.UI.Page
    Private Shared _servUsuarios As ServUsuarios

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _servUsuarios = New ServUsuarios()
    End Sub

    Protected Sub btn_Aceptar_Click(sender As Object, e As EventArgs) Handles btn_Aceptar.Click
        Dim usuario = _servUsuarios.ObtenerUsuarioPorUserPassword(txt_Usuario.Text, txt_Contrasena.Text)
        If usuario Is Nothing Then

        Else
            Session("usuario") = usuario
            Response.Redirect("listado.aspx")
            'Response.Redirect("forecast.aspx")
        End If
    End Sub
End Class